import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class code2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        while (T-- != 0) {
            long n = in.nextLong();
            long a = in.nextLong(), b = in.nextLong();
            long sum = 0;
            if (n <= 2) sum += Math.min(a, b);//边界情况
            else {
                if (3 * a < b * 2) {
                    //只选a
                    sum += a * (n / 2);
                    if (n % 2 == 1) {
                        //2+1 可以考虑三人船
                        sum += Math.min(Math.min(a, b), b - a);
                    }
                } else {
                    //选b
                    sum += b * (n / 3);
                    if (n % 3 == 1) {
                        //3+1 可以考虑双人船+双人船
                        sum += Math.min(2 * a - b, Math.min(a, b));
                    }
                    if (n % 3 == 2) {
                        //3+2 (2+2+2 || 3+2 || 3+3)
                        sum += Math.min(Math.min(a, b), 3 * a - b);
                    }

                }
            }
            System.out.println(sum);
        }
    }
}